<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增khgl')" />
            <th:block th:include="include :: datetimepicker-css" />
            <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<style>
    .jltable{
        margin: auto;
    }
    .jltable th,td{
        min-height: 40px;
        min-width: 50px;
        border: 1px solid #eee;
        padding: 10px;
    }
</style>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-khgl-add">
        <h4 class="form-header h4">客户信息</h4>
        <table class="jltable">
            <tbody>
                        <tr>
                            <td><label class="control-label is-required">单位名称：</label></td>
                            <td><input name="dwmc" class="form-control" type="text" required></td>
                            <td></td>
                            <td><label class="control-label">负责人：</label></td>
                            <td><input name="fzr" class="form-control" type="text"></td>
                        </tr>

                        <tr>
                            <td><label class="control-label">纳税编号：</label></td>
                            <td><input name="nsbh" class="form-control" type="text"></td>
                            <td></td>
                            <td><label class="control-label">负责人电话：</label></td>
                            <td><input name="fzrdh" class="form-control" type="text"></td>
                        </tr>

                        <tr>
                            <td><label class="control-label">单位性质：</label></td>
                            <td>
                                <select name="dwxz" class="form-control" th:with="type=${@dict.getType('khdwxz')}">
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </td>
                            <td></td>
                            <td><label class="control-label">业务类型：</label></td>
                            <td>
                                <select name="ywlx" class="form-control" th:with="type=${@dict.getType('khywlx')}">
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </td>
                        </tr>
            </tbody>
        </table>

        <h4 class="form-header h4" style="margin-top: 20px">详细信息</h4>
        <table class="jltable">
            <tbody>
                    <tr>
                        <td><label class="control-label">客户状态：</label></td>
                        <td>
                            <select name="khzt" class="form-control" th:with="type=${@dict.getType('khkhzt')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </td>
                        <td></td>
                        <td><label class="control-label">客户来源：</label></td>
                        <td>
                            <select name="khly" class="form-control" th:with="type=${@dict.getType('khkhly')}">
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><label class="control-label">派遣原因：</label></td>
                        <td><input name="pqyy" class="form-control" type="text"></td>
                        <td></td>
                        <td><label class="control-label">跟进时间：</label></td>
                        <td>
                            <div class="input-group date">
                                <input name="gjsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </td>
                    </tr>
            </tbody>
        </table>
        <h4 class="form-header h4" style="margin-top: 20px">业务信息</h4>
        <table class="jltable">
            <tbody>
                <tr>
                    <td><label class="control-label">需求类型：</label></td>
                    <td><input name="xqlx" class="form-control" type="text"></td>
                    <td><label class="control-label">服务时间：</label></td>
                    <td><input name="fwsj" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">需求人数：</label></td>
                    <td><input name="xqrs" class="form-control" type="text"></td>
                    <td><label class="control-label">到岗时间：</label></td>
                    <td>
                        <div class="input-group date">
                            <input name="dgsj" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </td>
                </tr>


                <tr>
                    <td><label class="control-label">年龄要求：</label></td>
                    <td><input name="nlyq" class="form-control" type="text"></td>
                    <td><label class="control-label">合同数：</label></td>
                    <td><input name="hts" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">用工单位编号：</label></td>
                    <td><input name="ygdwbh" class="form-control" type="text"></td>
                    <td><label class="control-label">业务员：</label></td>
                    <td><input name="ywy" class="form-control" type="text"></td>
                </tr>

                <tr>
                    <td><label class="control-label">说明：</label></td>
                    <td colspan="3"><textarea name="sm" class="form-control"></textarea></td>
                </tr>
                <tr>
                    <td><label class="control-label">相关文件：</label></td>
                    <td colspan="3">
                        <input type="hidden" name="xgwj">
                        <div class="file-loading">
                            <input class="form-control file-upload" id="xgwj" name="file" type="file">
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<th:block th:include="include :: footer" />
        <th:block th:include="include :: datetimepicker-js" />
        <th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var prefix = ctx + "lwpq/khgl"
    $("#form-khgl-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-khgl-add').serialize());
        }
    }

            $("input[name='gjsj']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });

            $("input[name='dgsj']").datetimepicker({
                format: "yyyy-mm-dd",
                minView: "month",
                autoclose: true
            });

            $(".file-upload").fileinput({
                uploadUrl: ctx + 'common/upload',
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
</script>
</body>
</html>